package com.online.service.user.Impl;

import com.online.dao.user.Impl.ShopDaoImpl;
import com.online.dao.user.Impl.UserDaoImpl;
import com.online.dao.user.ShopDao;
import com.online.dao.user.UserDao;
import com.online.pojo.UpComing_Shop;
import com.online.service.user.ShopService;

import java.sql.SQLException;
import java.util.List;

public class ShopServiceImpl implements ShopService {
    public boolean approval(String shop_name, String user_name, String pwd, String legal_p ,String tel) {
        ShopDao shopDao = new ShopDaoImpl();
        return shopDao.insertShop(shop_name,user_name,pwd,legal_p,tel);
    }

    public List<UpComing_Shop> select(List<UpComing_Shop> list) throws SQLException {
        ShopDao shopDao = new ShopDaoImpl();
        return shopDao.selectShop(list);
    }

    public boolean agree(String name) throws SQLException {
        UpComing_Shop shop;
        boolean falg=false;
        ShopDao shopDao = new ShopDaoImpl();
        shop= shopDao.select(name);
        shopDao.insertmerchant(shop.getShop_name(),shop.getUser_name(),shop.getPwd(),shop.getLegal_p(),shop.getTel(),0);
        return falg;
    }

    public boolean overrule(String name) throws SQLException {
        boolean falg=false;
        ShopDao shopDao = new ShopDaoImpl();
        shopDao.del(name);
        return falg;
    }


}
